home *** CD-ROM | disk | FTP | other *** search
- > How does recursive programming work? Suppose I wanted to make a
- > MineSweeper clone, how would I let the computer show all the
- > fields that aren't surrounded by a bomb whenever I hit a field
- > which is not surrounded by a bomb?
- > Mind, I'm not trying to make a clone here, I just thought it's
- > the best way to illustrate whatever I try to... well, er, try,
- > really :)
- >
-
- Recursive programming works by calling a procedure from itself.
- i.e.:
- Procedure Test[A]
- Inc A
- If A<10 Then Test[A]
- End proc
-
- I am not sure this example will work in Amos, though. I seem to
- remember that Amos has some limitations on recursion, for instance
- that the procedure calls may not be nested more than 15 times,
- which makes it useless for most applications.
-
- BTW, why would you want to use recursion for this Mines-clone. You
- could just check the array, could you not?
-
- Branko Collin
- bcollin@mpi.nl
-
-
-
-